package cn.tedu.csmall.product.preload;

import cn.tedu.csmall.product.service.BrandService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;

/**
 * 缓存预热类
 *
 * @author Chen
 * @since 2023/2/13 15:47:47
 */
@Slf4j
@Deprecated
//@Component
public class CachePreload implements ApplicationRunner {

    private final BrandService brandService;

//    @Autowired
    public CachePreload(BrandService brandService) {
        this.brandService = brandService;
    }

    @Override
    public void run(ApplicationArguments args) {
        log.debug("开始执行CachePreload.run()");
        brandService.rebuildCache();
    }

}
